package com.xydtech.ecard.config.service.impl;

import java.util.List;

import com.xydtech.common.annotation.DataScope;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.xydtech.ecard.config.mapper.EcardServeModuleConfigMapper;
import com.xydtech.ecard.config.domain.EcardServeModuleConfig;
import com.xydtech.ecard.config.service.IEcardServeModuleConfigService;
import com.xydtech.common.core.text.Convert;

/**
 * 服务模块配置Service业务层处理
 * 
 * @author JHON
 * @date 2022-06-23
 */
@Service
public class EcardServeModuleConfigServiceImpl implements IEcardServeModuleConfigService
{
    @Autowired
    private EcardServeModuleConfigMapper ecardServeModuleConfigMapper;

    /**
     * 查询服务模块配置
     * 
     * @param moduleId 服务模块配置主键
     * @return 服务模块配置
     */
    @Override
    public EcardServeModuleConfig selectEcardServeModuleConfigByModuleId(Long moduleId)
    {
        return ecardServeModuleConfigMapper.selectEcardServeModuleConfigByModuleId(moduleId);
    }

    /**
     * 查询服务模块配置列表
     * 
     * @param ecardServeModuleConfig 服务模块配置
     * @return 服务模块配置
     */
    @Override
    @DataScope(deptAlias = "a")
    public List<EcardServeModuleConfig> selectEcardServeModuleConfigList(EcardServeModuleConfig ecardServeModuleConfig)
    {
        return ecardServeModuleConfigMapper.selectEcardServeModuleConfigList(ecardServeModuleConfig);
    }

    /**
     * 新增服务模块配置
     * 
     * @param ecardServeModuleConfig 服务模块配置
     * @return 结果
     */
    @Override
    public int insertEcardServeModuleConfig(EcardServeModuleConfig ecardServeModuleConfig)
    {
        return ecardServeModuleConfigMapper.insertEcardServeModuleConfig(ecardServeModuleConfig);
    }

    /**
     * 修改服务模块配置
     * 
     * @param ecardServeModuleConfig 服务模块配置
     * @return 结果
     */
    @Override
    public int updateEcardServeModuleConfig(EcardServeModuleConfig ecardServeModuleConfig)
    {
        return ecardServeModuleConfigMapper.updateEcardServeModuleConfig(ecardServeModuleConfig);
    }

    /**
     * 批量删除服务模块配置
     * 
     * @param moduleIds 需要删除的服务模块配置主键
     * @return 结果
     */
    @Override
    public int deleteEcardServeModuleConfigByModuleIds(String moduleIds)
    {
        return ecardServeModuleConfigMapper.deleteEcardServeModuleConfigByModuleIds(Convert.toStrArray(moduleIds));
    }

    /**
     * 删除服务模块配置信息
     * 
     * @param moduleId 服务模块配置主键
     * @return 结果
     */
    @Override
    public int deleteEcardServeModuleConfigByModuleId(Long moduleId)
    {
        return ecardServeModuleConfigMapper.deleteEcardServeModuleConfigByModuleId(moduleId);
    }

    @Override
    public List<EcardServeModuleConfig> findServeModuleList(Long deptId) {
        return ecardServeModuleConfigMapper.findServeModuleList(deptId);
    }
}
